package com.edgar.music.artist.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.edgar.music.R;
import com.edgar.music.artist.ArtistManager;
import com.edgar.music.artist.adapter.ArtistCategoryListAdapter;
import com.edgar.music.base.MusicFragment;

/**
 * Created by Edgar on 2017/1/2.
 * 歌手分类fragment
 */
public class ArtistCategoryFragment extends MusicFragment{

    private ListView mArtistCategoryList;
    private ArtistCategoryListAdapter mArtistCategoryListAdapter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.artist_category_list,container,false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        mArtistCategoryList = (ListView) view.findViewById(R.id.artist_category_list);
        mArtistCategoryListAdapter = new ArtistCategoryListAdapter(getContext());
        mArtistCategoryListAdapter.addAll(ArtistManager.getInstance().getArtistCategoryList());
        mArtistCategoryList.setAdapter(mArtistCategoryListAdapter);
    }
}